home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / comm / cnet / bbsmon.lha / wh.rexx next >
Encoding:
OS/2 REXX Batch file  |  1995-03-29  |  5.6 KB  |  233 lines

  1. /**/
  2. options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  3. tr=transmit;ss=sendstring;gc=getchar;gu=getuser
  4. if ~show('L',"rexxsupport.library") then do
  5.     if ~(addlib("rexxsupport.library",0,-30,0)) then do
  6.         tr 'Need rexxsupport.library in LIBS:'
  7.         exit
  8.     end
  9. end
  10. regname='~'
  11. if exists('s:whmon.key')=1 then do
  12.     call open(1,'s:whmon.key',r)
  13.     regname=readln(1)
  14.     regname=c2b(regname)
  15.     regname=left(right(regname,length(regname)-4),length(regname)-8)
  16.     regname=b2c(regname)
  17.     call close(1)
  18. end
  19. getuser 2307050
  20. bbsname=result
  21. /*                    12345678901234567890123456789012345678901234567890123456789012345678901234567890*/
  22. titlebar='n1z4cf#*Handle               Where           H*U M*U CU Logon Idle Left  Baud  Cmdq1'
  23.  
  24. minport=0    /* Configure these for your minimum and maximum ports to be displayed */
  25. maxport=9
  26.  
  27. if exists('s:whmon.config')=1 then do
  28.     call open(1,'s:whmon.config',r)
  29.     if eof(1)=0 then minport=readln(1)
  30.     if eof(1)=0 then maxport=readln(1)
  31.     call close(1)
  32. end
  33.  
  34. pb="00000000"x
  35. getuser 23
  36. myport=result
  37. getuser 1200032
  38. timeenter=result/10
  39. getuser 17
  40. maint=result
  41. if ~(maint=0) then maint=1
  42. getuser (2424286+(4*myport))
  43. pnt=result
  44. temp=import(offset(pb,pnt+661),1)
  45. if left(c2b(temp),1)='1' then confctrl=1
  46. else confctrl=0
  47. getuser 1302307
  48. arg1=result
  49. pos=index(arg1,'-')
  50.     if pos>0 then do
  51.         minport=left(arg1,pos-1)
  52.         if (minport<0)|(minport>99) then do
  53.             tr 'Invalid Range'
  54.             exit
  55.         end
  56.         maxport=right(arg1,length(arg1)-pos)
  57.         if (maxport<minport)|(maxport>99) then do
  58.             tr 'Invalid Range'
  59.             exit
  60.         end
  61.     end
  62.    else if length(arg1)>0 then do
  63.         if datatype(arg1,n)=1 then do
  64.             if (arg1>=0)&(arg1<=99) then do
  65.                 minport=arg1
  66.                 maxport=arg1
  67.             end
  68.             else do
  69.                 tr 'Invalid Port'
  70.                 exit
  71.             end
  72.         end
  73.         else if arg1='?' then do
  74.             tr 'cfz4Quick Who Monitor List v1.0a by Josef Faulknerq1'
  75.             tr 'This program is a sub-program of my BBS Monitor.  It is intended to get'
  76.          tr 'the same information as you can from the BBS Monitor without doing a   '
  77.          tr 'complete screen clear, and bother waiting to load the full program.    '
  78.          tr 'Color codes and such are the same as shown in the help of the BBS Monitor.'
  79.          tr 'If you do not have the BBS Monitor, email panther@gate.net for more info.'
  80.          tr 'Arguments can be a range (ex: 1-5)  or a single number.'
  81.             exit
  82.         end
  83.         else do
  84.             tr 'c7Invalid Argument "'arg1'". (must be numerical, a range, or ? for info)'
  85.             exit
  86.         end
  87.     end
  88.  
  89. tr titlebar
  90. do port=minport to maxport
  91.     getportid port
  92.     pid=result
  93.     if pid>-1 then do
  94.  
  95.         getuser (2424286+(4*port))
  96.         pnt=result
  97.  
  98.         da=import(offset(pb,pnt+72),20)
  99.         temphandle=left(da,(index(da,"00"x)-1))
  100.  
  101.         da=import(offset(pb,pnt+28),2)
  102.         timeleft=(c2d(da,2))/10
  103.  
  104.         da=import(offset(pb,pnt+30),2)
  105.         timeidle=(c2d(da,2))/10
  106.         if timeidle=0.1 then timeidle=0
  107.  
  108.         da=import(offset(pb,pnt+461),1)
  109.         gender=c2d(da,1)
  110.  
  111.         da=import(offset(pb,pnt+32),2)
  112.         timeon=(c2d(da,2))/10
  113.  
  114.         da=import(offset(pb,pnt+1744),1)
  115.         hideall=c2d(da)
  116.         if hideall=1 then hideall='*'
  117.         else hideall='-'
  118.  
  119.         da=import(offset(pb,pnt+1745),1)
  120.         muffall=c2d(da)
  121.         if muffall=1 then muffall='*'
  122.         else muffall='-'
  123.  
  124.         da=import(offset(pb,pnt+452),1)
  125.         textset=c2d(da)
  126.         if textset=0 then textset='ce'
  127.         else if textset=1 then textset='cb'
  128.         else if textset=2 then textset='ca'
  129.       else textset='c9'
  130.  
  131.         da=import(offset(pb,pnt+1743),1)
  132.         olmwait=c2d(da)
  133.         if olmwait=1 then olmwait='*'
  134.         else olmwait='-'
  135.  
  136.         da=import(offset(pb,pnt+7358),5)
  137.         lastcmd=strip(da,,"00"x)
  138.     
  139.         da=import(offset(pb,pnt+542),2)
  140.         logoncps=(c2d(da,2))*10
  141.         getwhere port
  142.         where=result
  143.  
  144.         da=c2b(import(offset(pb,pnt+(myport+1630)),1))
  145.         hide=BitTST(da,0)
  146.         if right(da,1)='1' then do
  147.             if confctrl=1 then do
  148.                 handle=temphandle
  149.                 hide='*'
  150.                 extra=''
  151.             end
  152.             else do
  153.                 hide='+'
  154.                 handle='Hidden'
  155.                 extra='ca'
  156.             end
  157.         end
  158.         else do
  159.             hide='-'
  160.             handle=temphandle
  161.             extra=''
  162.         end
  163.         if left(right(da,2),1)='1' then do
  164.             if confctrl=1 then muff='*'
  165.             else muff='+'
  166.         end
  167.         else muff='-'
  168.         if left(right(da,4),1)='1' then chat='*'
  169.         else chat='-'
  170.  
  171.         getuser 1101630+port
  172.         da=c2b(result)
  173.         if right(da,1)='1' then myhide='*'
  174.         else myhide='-'
  175.         if left(right(da,2),1)='1' then mymuff='*'
  176.         else mymuff='-'
  177.         if left(right(da,4),1)='1' then mychat='*'
  178.         else mychat='-'
  179.  
  180.         ss textset
  181.         ss port//10
  182.         if olmwait='*' then ss'*'
  183.         else ss ' '
  184.         if gender=0 then ss 'c9'
  185.         else if gender=1 then ss'cc'
  186.         ss extra
  187.         ss left(handle,21,' ')
  188.         ss 'ce'left(where,16,' ')
  189.         ss 'cd'hide
  190.         ss 'cd'hideall
  191.         ss 'cd'myhide
  192.         ss ' '
  193.         ss 'cd'muff
  194.         ss 'cd'muffall
  195.         ss 'cd'mymuff
  196.         ss ' '
  197.         ss 'cd'chat
  198.         ss 'cd'mychat
  199.         ss ' '
  200.         ss 'ca'left(timeon,6,' ')
  201.         if timeidle>3 then ss 'cb'
  202.         else if timeidle>5 then ss 'c9'
  203.         else ss 'ca'
  204.         ss left(timeidle,5,' ')
  205.         ss 'ca'
  206.         if timeleft<10 then ss 'c9'
  207.         else if timeleft<30 then ss'cb'
  208.         else ss'ca'
  209.         if timeleft=999 then ss 'UNLIM '
  210.         else ss left(timeleft,6,' ')
  211.         if logoncps<2400 then ss 'c9'
  212.         else if logoncps<9600 then ss 'cb'
  213.         else if logoncps>14400 then ss 'ce'
  214.         else ss 'ca'
  215.         ss left(logoncps,6,' ')
  216.         ss 'cb'lastcmd'n1'
  217.     end
  218.     else do
  219.         getwhere port
  220.         ss 'c7'port//10'                      c6'result'n1'
  221.     end
  222. end
  223. if bbsname~=regname then tr 'z4cfQuick Who Monitor List v1.0a by Josef Faulkner (panther@gate.net) z1UnRegisteredq1'
  224. else tr 'z4cfQuick Who Monitor List v1.0a by Josef Faulkner (panther@gate.net) z2 Registered q1'
  225. exit
  226.  
  227. SYNTAX: ; ERROR: ; IOERR: ; er=rc' ('errortext(rc)') in line 'sigl
  228.     getuser 1311992 ; a=result ; getuser 1311960 ; b=result ; c='"'a||b'"'
  229.     er='Error Code 'er' of 'c ; transmit er ; logentry er ; bufferflush
  230. exit
  231. /*
  232. $VER: CNet Quick BBS Monitor, v1.0a (27-Mar-95) by Josef Faulkner*/
  233.